/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.diagram.statemachine.figure;

import org.eclipse.draw2d.Ellipse;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.geometry.Rectangle;

/**
 * FinalStateFigure.
 * 
 * @author David Servat
 * @since 10 apr. 07
 */
public class FinalStateFigure extends Ellipse{
 
	/**
     * Default Constructor.
     */
    public FinalStateFigure(){
        super();
    }

    /**
     * @see org.eclipse.draw2d.Shape#fillShape(org.eclipse.draw2d.Graphics)
     */
    @Override
    protected void fillShape(Graphics graphics){
        final int space = 5;

        Rectangle f = Rectangle.SINGLETON;
        Rectangle r = getBounds();
        f.x = r.x + space;
        f.y = r.y + space;
        f.width = r.width - space * 2;
        f.height = r.height - space * 2;

        graphics.fillOval(f);
    }
}